package com.zhl.dao_;

import com.zhl.entity.Message;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * Created by Administrator on 2018/10/12.
 */
@Mapper
public interface MessageMapper {

    //查询所有主留言
    List<Message> messageList();
    //查询所有主留言下的回复
    List<Message> childMessageList(@Param("id") int id);

    int addMessage(Message message);
    Message queryMessageById(int id);
    int updateHaschild(Message message);
    List<Message> commentList(@Param("belongArticle") int belongArticle);

    int deleteMessageByArticleId(@Param("belongArticle")int belongArticle);
    int deleteMessageByWriteBack(@Param("writeBack")int writeBack);
    int deleteMessageById(@Param("id")int id);

}
